fix(remote): share the follow cursor between remote logs and the fleet dashboard - #146
Merged
Conversation
…t dashboard A remote node's log read ignored its resume position and re-fetched the whole tail on every poll. Since the fleet dashboard's detail view and `fleet logs -f` accumulate what a node returns, this made a remote node's log replay its most recent lines on every poll. Extract the dedup-by-id, overlap-window cursor `spinloop remote logs -f` already used into internal/remote.FollowCursor and have both it and the fleet's remoteNode share it, so the two follows cannot drift apart.
Adds the remote-node spec's requirement that reading a remote environment's logs resumes without duplicating events, sharing the follow cursor with `spinloop remote logs -f` — the guarantee the previous commit's fix implements.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the fleet dashboard replaying the same log lines on a remote node's detail view.
Summary
Logscall ignored its resume position and re-fetched its whole tail on every poll; since the dashboard's detail view andfleet logs -faccumulate what a node returns, this replayed the most recent lines every ~3s poll on a remote node.spinloop remote logs -falready used intointernal/remote.FollowCursor, and has the fleet'sremoteNodeshare the exact same cursor, so the two follows can't drift apart.remote-nodespec requirement documenting the no-duplicate follow guarantee, via the OpenSpec propose → apply → archive flow.Implementation details
remoteNodenow holds its own*remote.FollowCursor, since the genericfleet.Node.Logs(offset, limit)interface only threads back a singleint64— nowhere to carry an event-id set.offsetis repurposed as a binary signal (daemon.TailLogresets the cursor for a fresh view-open; anything else continues).